﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.ajax({
            url: "../data/system.aspx?method=102",
            async: false,
            success: function (text) {
                if (text == "no")
                    window.location = "../system/error.html";
                else if (text == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                    var tabs = parent.mini.get("mainTabs");
                    var tab1 = tabs.getTab("tab$rec");
                    var tab2 = tabs.getTab("tab$102");
                    tab2.enabled = true;
                    tabs.removeTab(tab1);
                    tabs.activeTab(tab2);
                }
            }
        });

        var str = window.location.search;
        var arr = str.split("=");
        var cuno = arr[1].substr(0, arr[1].indexOf('&'));
        var States = [{ id: 0, text: '未审核' }, { id: 1, text: '已审通过' }, { id: 2, text: '已审未通过' }, { id: 3, text: '显示' }, { id: 4, text: '隐藏' }, { id: 5, text: '已回收' }, { id: -1, text: '全部'}];
    </script>
</head>
<body>
    <div class="mini-fit" >
        <div id="divList" class="mini-fit" >
            <div class="mini-toolbar" style="border-bottom:0;">
                <table>
                    <tr>
                        <td><div id="comname"></div></td>
                        <td>
                            类型：
                            <input id="type" class="mini-combobox" style="width: 100px;" data="States" value="-1"/>
                            <a class="mini-button" iconcls="icon-search" plain="true" onclick="search()">查询</a>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <a class="mini-button" iconcls="icon-add" plain="true" onclick="addRow()">新增</a>
                            <a class="mini-button" iconcls="icon-remove" plain="true" onclick="delRows()">删除</a>
                            <span class="separator"></span>
                            <a class="mini-button" plain="true" iconcls="icon-ok" onclick="checkRows(1)">审核通过</a>
                            <a class="mini-button" plain="true" iconcls="icon-no" onclick="checkRows(2)">审核不通过</a>
                            <span class="separator"></span>
                            <a class="mini-button" plain="true" iconcls="icon-lock" onclick="lockRows(1)">隐藏</a>
                            <a class="mini-button" plain="true" iconcls="icon-unlock" onclick="lockRows(0)">显示</a>
                            <span class="separator"></span>
                            <a class="mini-button" plain="true" iconcls="icon-tip" onclick="zeroRows()">归零</a>
                            <span class="separator"></span>
                            <a class="mini-button" plain="true" iconcls="icon-reload" onclick="refreash()">刷新</a>
                        </td>
                    </tr>
                </table>
           </div>
            <div class="mini-fit">
                <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" allowresize="true" url="../data/system.aspx?method=GetRecruitList" idField="id" multiSelect="true">
                    <div property="columns">
                        <div type="checkcolumn" ></div>  
                        <div cellCls="actionIcons" name="action" width="45" headerAlign="center" align="center" renderer="onActionRenderer" cellStyle="padding:0;">操作</div>
                        <div field="re_name" width="150" headerAlign="center" align="center" allowSort="true" renderer="onNameRenderer">职位名称</div>
                        <div field="re_state" width="50px" align="center" headeralign="center" allowsort="true" renderer="onStateRenderer">状态</div>
                        <div field="re_delete" width="50px" align="center" headeralign="center" allowsort="true" renderer="onDeleteRenderer">回收站</div>
                        <div field="re_num" width="60" headerAlign="center" align="center" allowSort="true" renderer="onNumRenderer">人数</div>
                        <div field="re_effecttime" width="50" align="center" headerAlign="center" allowSort="true">有效期</div>
                        <div field="re_modifytime" width="80" align="center" allowSort="true" headerAlign="center" dateFormat="yyyy-MM-dd">发布日期</div>
                        <div field="re_endtime" width="80" allowSort="true" align="center" headerAlign="center" dateFormat="yyyy-MM-dd">到期日期</div>
                        <div field="re_hits" width="80" headerAlign="center" align="center" allowSort="true" >点击率</div>
                        <div field="re_resumenum" width="80" headerAlign="center" align="center" allowSort="true" >投递简历数</div>
                    </div>
                </div>
            </div>
        </div>
        <div id="editForm" class="form" style="display:none">
            <fieldset style="border: solid 1px #aaa; width: 740px">
                <legend><strong>职位详细信息</strong><span class="red">( 带 * 号的必须填写)</span></legend>
                <input class="mini-hidden" name="re_no" />
                <input class="mini-hidden" name="re_cuno" />
                <input class="mini-hidden" name="cu_name" />
                <table style="width: 100%;">
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;岗位名称：
                        </td>
                        <td>
                            <input class="mini-textbox" name="re_name" style="width: 280px" required="true" />
                        </td>
                        <td colspan="2" style="text-align: left">
                            <input name="re_need" class="mini-checkbox" text="紧缺岗位"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;招聘人数：
                        </td>
                        <td colspan="3">
                            <input class="mini-textbox" name="re_num" style="width: 50px" required="true" vtype="int" />&nbsp;人（0
                            表示若干，只能填写数字，切换成英文输入）
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;性别：
                        </td>
                        <td>
                            <input class="mini-combobox" name="re_sex" style="width: 100px" required="true" textfield="di_name"
                                required="true" valuefield="di_code" url="../data/system.aspx?method=CbxSex" />
                        </td>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;工作性质：
                        </td>
                        <td>
                            <input class="mini-combobox" name="re_kind" style="width: 100px" required="true"
                                textfield="di_name" required="true" valuefield="di_code" url="../data/system.aspx?method=CbxKind" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle" style="width: 120px;">
                            <span style="color: Red">*</span>&nbsp;&nbsp;学历：
                        </td>
                        <td style="width: 200px;">
                            <input class="mini-combobox" name="re_edu" style="width: 100px" required="true" textfield="di_name"
                                required="true" valuefield="di_code" url="../data/system.aspx?method=CbxEdu" />&nbsp;&nbsp;
                            <input name="re_edu2" class="mini-checkbox" checked="true" text="以上"/>
                        </td>
                        <td class="tdtitle" style="width: 120px">
                            <span style="color: Red">*</span>&nbsp;&nbsp;招聘对象：
                        </td>
                        <td style="width: 200px">
                            <input class="mini-combobox" name="re_target" style="width: 180px" required="true"
                                textfield="di_name" required="true" valuefield="di_code" url="../data/system.aspx?method=CbxTarget" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;岗位类别1：
                        </td>
                        <td>
                            <input class="mini-combobox" style="width: 180px;" name="re_jobtype1" textfield="jt_name"
                                required="true" valuefield="jt_id" url="../data/system.aspx?method=CbxPJobType" onvaluechanged="onType1Changed"/>
                        </td>
                        <td class="tdtitle">
                            岗位类别11：
                        </td>
                        <td>
                            <input class="mini-combobox" style="width: 180px;" name="re_jobtype11" textfield="jt_name"
                                valuefield="jt_id"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            &nbsp;&nbsp;岗位类别2：
                        </td>
                        <td>
                            <input class="mini-combobox" style="width: 180px;" name="re_jobtype2" textfield="jt_name"
                                valuefield="jt_id" url="../data/system.aspx?method=CbxPJobType" onvaluechanged="onType2Changed"/>
                        </td>
                        <td class="tdtitle">
                            岗位类别22：
                        </td>
                        <td>
                            <input class="mini-combobox" style="width: 180px;" name="re_jobtype22" textfield="jt_name"
                                valuefield="jt_id"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            年龄：
                        </td>
                        <td colspan="3">
                            <input class="mini-textbox" style="width: 80px;" name="re_age" />（空白表示不限）
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;待遇：
                        </td>
                        <td colspan="3">
                            <input class="mini-combobox" name="re_pay1" data="Pay" required="true"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;工作地区：
                        </td>
                        <td>
                            <input class="mini-combobox" name="re_area" style="width: 100px" required="true"
                                textfield="di_name" required="true" valuefield="di_code" url="../data/system.aspx?method=CbxArea" />
                        </td>
                        <td class="tdtitle">
                            <span style="color: Red">*</span>&nbsp;&nbsp;有效期：
                        </td>
                        <td>
                            <input class="mini-textbox" name="re_effecttime" style="width: 60px" required="true"
                                vtype="int" />&nbsp;天
                        </td>
                    </tr>
                    <tr>
                        <td class="tdtitle">
                            其他要求：
                        </td>
                        <td colspan="3">
                            <input class="mini-textarea" name="re_memo" style="width: 570px; height: 80px" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align:center;padding:5px;">
                            <a class="mini-button" style="width:60px;" onclick="updateRow()">保存</a>
                            <span style="display:inline-block;width:25px;"></span>
                            <a class="mini-button" style="width:60px;" onclick="cancelRow()">取消</a>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div> 
    </div>
</body>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            complete: function (XMLHttpRequest, textStatus) {
                if (XMLHttpRequest.responseText == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                }
            }
        });

        mini.parse();

        $.ajax({
            url: "../data/system.aspx?method=GetCompanyName",
            async: false,
            data: { id: cuno },
            success: function (text) {
                $("#comname").html("企业名称：<font color='Blue'>" + text + "</font>");
                mini.getbyName("cu_name").setValue(text);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                ShowMessage("系统提示", "页面加载失败！", 3);
            }
        });

        var grid = mini.get("datagrid1");
        search();

        function search() {
            var type = mini.get("type").getValue();
            grid.load({ cuno: cuno, type: type });
            grid.sortBy("re_no", "desc");
        }

        function onActionRenderer(e) {
            var record = e.record;
            var s = '<span class="icon-edit actionspan" title="查看" onclick="editRow(' + record._uid + ')"></span><span class="separator"></span><span class="icon-remove actionspan" title="删除" onclick="delRow(' + record._uid + ')"></span>';
            return s;
        }

        //招聘岗位显示方式
        function onNameRenderer(e) {
            var record = e.record;
            //var s = '<a class="linelink" title="预览" target="_blank" href="../../Web/Job/' + record.re_no + '.html">' + record.re_name + '</a>';
            var s = '<a class="linelink">' + record.re_name + '</a>';
            if (record.re_hide == 1) {
                s = s + "<span style='color:Red'>[隐]</span>";
            }
            var myDate = new Date();

            if (record.re_endtime < myDate) {
                s = s + "<span style='color:#cccccc'>[过期]</span>";
            }
            return s;
        }

        //状态显示
        function onStateRenderer(e) {
            var s;
            if (e.value == 1)
                s = '<font color="Green">已审通过</font>';
            else if (e.value == 2)
                s = '<font color="Red">已审未通过</font>';
            else
                s = '未审核';
            return s;
        }

        //回收站显示
        function onDeleteRenderer(e) {
            var s;
            if (e.value == 1)
                s = '<font color="Red">已回收</font>';
            return s;
        }

        //人数显示
        function onNumRenderer(e) {
            if (e.value == 0)
                return "若干";
            return e.value;
        }

        function addRow() {
            var form = new mini.Form("#editForm");
            form.clear();
            mini.getbyName("re_cuno").setValue(cuno);
            $("#divList").hide();
            $("#editForm").show();
        }

        function editRow(row_uid) {
            var row = grid.getRowByUID(row_uid);
            if (row) {
                $("#divList").hide();
                $("#editForm").show();
                var form = new mini.Form("#editForm");
                form.clear();
                form.loading();
                $.ajax({
                    url: "../data/system.aspx?method=GetRecruit",
                    data: { id: row.re_no },
                    success: function (text) {
                        form.unmask();
                        if (text == "out") {
                            $("#editForm").hide();
                            $("#divList").show();
                            var loginWindow = parent.mini.get("loginWindow");
                            if (!loginWindow.visible)
                                loginWindow.show();
                            return;
                        }
                        var o = mini.decode(text);
                        form.setData(o);
                        var type1 = mini.getbyName("re_jobtype1").getValue();
                        var url = "../data/system.aspx?method=CbxCJobType&id=" + type1
                        mini.getbyName("re_jobtype11").setUrl(url);
                        var type2 = mini.getbyName("re_jobtype2").getValue();
                        url = "../data/system.aspx?method=CbxCJobType&id=" + type2
                        mini.getbyName("re_jobtype22").setUrl(url);
                        if (o.re_edu2 == "") {
                            mini.getbyName("re_edu2").setChecked(false);
                        } else {
                            mini.getbyName("re_edu2").setChecked(true);
                        }
                    }
                });
            }
        }

        function updateRow() {
            var form = new mini.Form("#editForm");
            form.validate();
            if (form.isValid() == false)
                return;
            var o = form.getData();
            var json = mini.encode(o);
            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '保存中，请稍后...' });

            $.ajax({
                url: "../data/system.aspx?method=SaveRecruit",
                type: "post",
                data: { data: json },
                success: function (ret) {
                    mini.unmask(document.body);
                    if (ret == "out") {
                        var loginWindow = parent.mini.get("loginWindow");
                        if (!loginWindow.visible)
                            loginWindow.show();
                        return;
                    }
                    if (ret == 1) {
                        $("#divList").show();
                        $("#editForm").hide();
                        form.clear();
                        ShowMessage("系统提示", "招聘职位保存成功！", 1);
                        grid.reload();
                        creatHtml();
                    }
                    else if (ret == 0) {
                        $("#divList").show();
                        $("#editForm").hide();
                        form.clear();
                        ShowMessage("系统提示", "该招聘职位已不存在，请确认！", 2);
                        grid.reload();
                    }
                    else
                        ShowMessage("系统提示", "招聘职位保存失败！", 3);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    mini.unmask(document.body);
                    ShowMessage("系统提示", "招聘职位保存失败！", 3);
                }
            });
        }

        function cancelRow() {
            var form = new mini.Form("#editForm");
            form.clear();
            $("#divList").show();
            $("#editForm").hide();
        }

        function delRow(row_uid) {
            var row = grid.getRowByUID(row_uid);
            if (row) {
                mini.confirm("确定删除此招聘岗位吗？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '删除中，请稍后...' });
                            $.ajax({
                                url: "../data/system.aspx?method=DeleteRecruit",
                                data: { id: row.re_no },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘岗位删除成功！", 1);
                                        grid.reload();
                                        creatHtml();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘岗位删除失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘岗位删除失败！", 3);
                                }
                            });
                        }
                    }
                );
            }
        }

        function delRows() {
            var rows = grid.getSelecteds();
            if (rows.length > 0) {
                mini.confirm("确定删除所选招聘岗位吗？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '删除中，请稍后...' });
                            var ids = "";
                            for (var i = 0; i < rows.length; i++) {
                                ids += rows[i].re_no + ',';
                            }

                            $.ajax({
                                url: "../data/system.aspx?method=DeleteRecruit",
                                type: "post",
                                data: { id: ids },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘岗位删除成功！", 1);
                                        grid.reload();
                                        creatHtml();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘岗位删除失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘岗位删除失败！", 3);
                                }
                            });
                        }
                    }
                );
            } else
                ShowMessage("系统提示", "请选择需要删除的招聘岗位！", 2);
        }

        //选中审核
        function checkRows(state) {
            var rows = grid.getSelecteds();
            if (rows.length > 0) {
                mini.confirm("确定审核所选招聘职位吗？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '操作中，请稍后...' });
                            var ids = "";
                            for (var i = 0; i < rows.length; i++) {
                                ids += rows[i].re_no + ',';
                            }

                            $.ajax({
                                url: "../data/system.aspx?method=CheckRecruit",
                                type: "post",
                                data: { id: ids, state: state },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘职位审核成功！", 1);
                                        grid.reload();
                                        creatHtml();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘职位审核失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘职位审核失败！", 3);
                                }
                            });
                        }
                    }
                );
            } else
                ShowMessage("系统提示", "请选择需要审核的招聘职位！", 2);
        }

        function lockRows(state) {
            var rows = grid.getSelecteds();
            var msg = "隐藏";
            if (state == 0)
                msg = "显示";
            if (rows.length > 0) {
                mini.confirm("确定" + msg + "所选招聘岗位？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '操作中，请稍后...' });
                            var ids = "";
                            for (var i = 0; i < rows.length; i++) {
                                ids += rows[i].re_no + ',';
                            }

                            $.ajax({
                                url: "../data/system.aspx?method=LockRecruit",
                                type: "post",
                                data: { id: ids, state: state },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘岗位" + msg + "成功！", 1);
                                        grid.reload();
                                        creatHtml();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘岗位" + msg + "失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘岗位" + msg + "失败！", 3);
                                }
                            });
                        }
                    }
                );
            } else
                ShowMessage("系统提示", "请选择需要" + msg + "的招聘岗位！", 2);
        }

        //归零
        function zeroRows() {
            var rows = grid.getSelecteds();
            if (rows.length > 0) {
                mini.confirm("确定将所选招聘岗位的点击率归零吗？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '操作中，请稍后...' });
                            var ids = "";
                            for (var i = 0; i < rows.length; i++) {
                                ids += rows[i].re_no + ',';
                            }

                            $.ajax({
                                url: "../data/system.aspx?method=ZeroRecruit",
                                type: "post",
                                data: { id: ids },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘岗位点击率归零成功！", 1);
                                        grid.reload();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘岗位点击率归零失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘岗位点击率归零失败！", 3);
                                }
                            });
                        }
                    }
                );
            } else
                ShowMessage("系统提示", "请选择需要归零的招聘岗位！", 2);
        }

        //刷新
        function refreash() {
            var rows = grid.getSelecteds();
            if (rows.length > 0) {
                mini.confirm("确定将所选招聘岗位刷新吗？", "系统提示",
                    function (action) {
                        if (action == "ok") {
                            mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '操作中，请稍后...' });
                            var ids = "";
                            for (var i = 0; i < rows.length; i++) {
                                ids += rows[i].re_no + ',';
                            }

                            $.ajax({
                                url: "../data/system.aspx?method=RefreshRecruit",
                                type: "post",
                                data: { id: ids },
                                success: function (ret) {
                                    mini.unmask(document.body);
                                    if (ret == "out") {
                                        var loginWindow = parent.mini.get("loginWindow");
                                        if (!loginWindow.visible)
                                            loginWindow.show();
                                        return;
                                    }
                                    if (ret >= 0) {
                                        ShowMessage("系统提示", "招聘岗位刷新成功！", 1);
                                        grid.reload();
                                        creatHtml();
                                    }
                                    else
                                        ShowMessage("系统提示", "招聘岗位刷新失败！", 3);
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    mini.unmask(document.body);
                                    ShowMessage("系统提示", "招聘岗位刷新失败！", 3);
                                }
                            });
                        }
                    }
                );
            } else
                ShowMessage("系统提示", "请选择需要刷新的招聘岗位！", 2);
        }

        function CloseWindow(action) {
            window.CloseOwnerWindow("ok");
            var tabs = parent.mini.get("mainTabs");
            var tab = tabs.getTab("tab$102");
            tab.enabled = true;
            var iframe = tabs.getTabIFrameEl(tab);
            iframe.contentWindow.search();
            tabs.activeTab(tab);
        }

        function onDrawCell(e) {
            var item = e.record, field = e.field, value = e.value;
            //组织HTML设置给cellHtml
            if (item.jt_pid == 0)
                e.cellHtml = '<span style="color:red;">' + value + '</span>';
        }

        function onType1Changed(e) {
            var type1 = mini.getbyName("re_jobtype1").getValue();
            mini.getbyName("re_jobtype11").setValue("");
            var url = "../data/system.aspx?method=CbxCJobType&id=" + type1
            mini.getbyName("re_jobtype11").setUrl(url);
            mini.getbyName("re_jobtype11").select(0);
        }

        function onType2Changed(e) {
            var type2 = mini.getbyName("re_jobtype2").getValue();
            mini.getbyName("re_jobtype22").setValue("");
            var url = "../data/system.aspx?method=CbxCJobType&id=" + type2
            mini.getbyName("re_jobtype22").setUrl(url);
            mini.getbyName("re_jobtype22").select(0);
        }

        function creatHtml() {
            mini.confirm("是否生成首页静态页面？", "系统提示",
                function (action) {
                    if (action == "ok") {
                        mini.mask({ el: document.body, cls: 'mini-mask-loading', html: '生成中，请稍后...' });
                        $.ajax({
                            url: "../data/system.aspx?method=CreateHtml",
                            type: "post",
                            data: { webset: webset },
                            success: function (ret) {
                                mini.unmask(document.body);
                                if (ret == "out") {
                                    var loginWindow = parent.mini.get("loginWindow");
                                    if (!loginWindow.visible)
                                        loginWindow.show();
                                    return;
                                }
                                if (ret == 1) {
                                    ShowMessage("系统提示", "静态页面生成成功！", 1);
                                }
                                else
                                    ShowMessage("系统提示", "静态页面生成失败！", 3);
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                mini.unmask(document.body);
                                ShowMessage("系统提示", "静态页面生成失败！", 3);
                            }
                        });
                    }
                }
            );
        }
    </script>
</html>
